import 'package:flutter/material.dart';
import 'package:Smart/utils/screen_unit/gs_screen_util.dart';

//不带图片的激活页面
//加一个方法做判断，根据不同的状态使用不同的文字（这只是一个想法，还没有实现）
class GsGetPermission extends StatelessWidget {

  String str1='未开启手机蓝牙';
  String str2 = '手机蓝牙未打开，会导致蓝牙钥匙激活失败';
  String str3 = '请前往手机设置开启蓝牙功能';
  @override
  Widget build(BuildContext context) {
    return Container(
        height:400.h,
        decoration: BoxDecoration(
            color: Colors.white,
            //设置顶部圆角
            borderRadius: BorderRadius.only(
              topLeft: const Radius.circular(25.0),
              topRight: const Radius.circular(25.0),
            )
        ),
        child: Column(
          children: [
            topText(),
            secondText(str1),
            threeText(str2,str3),

            gotoBottom(),
          ],
        )

    );
  }
  Widget topText(){
    return Container(
      padding: EdgeInsets.only(top:36),
      child: Center(
        child: Text('蓝牙钥匙激活',
          style: TextStyle(
              fontSize: 28.sp
          ),
        ),
      )

    );
  }
  Widget secondText(String str1){
    return Container(
      padding: EdgeInsets.only(top:36),
      child: Center(
        child: Text(str1,
          style: TextStyle(
              fontSize: 18.sp
          ),
        ),
      )

    );
  }
  Widget threeText(String str2,String str3){
    return Container(
        padding: EdgeInsets.only(top:25.h),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(str2,
              style: TextStyle(
                  fontSize: 16.sp
              ),
            ),
            Text(str3,
              style: TextStyle(
                  fontSize: 16.sp
              ),
            ),
          ],
        )
    );
  }
  //立即前往
  Widget gotoBottom(){
    return Container(
      width: 356.w,
      height: 48.h,
      margin: EdgeInsets.only(top:60.h),
      child: RaisedButton(
        elevation: 0,//值越大，阴影越重
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(50),
        ),
        // borderSide: BorderSide(color: Color(0xffD1E000)),
        padding: EdgeInsets.fromLTRB(29.w,0,29.w,0),
        color: Color(0xffD7E600),
        child: Text(
          '确定',
          style: TextStyle(
            color: Color(0xff141413),
            fontSize: 18.sp,
          ),
        ),
        onPressed: () {

        },
      ),
    );
  }
}

